<?php 
include_once($_SERVER['DOCUMENT_ROOT'].'/home/public/header.php');
$sum=3;
$p=isset($_GET['p'])&&!empty($_GET['p'])?$_GET['p']:1;
$off=($p-1)*3; 
$res=sel($config,'message',"limit {$off},{$sum}");
// $res_users=sel($config,'users');

 ?>
 

<div class="container text-danger text-center">
<div class="moodlist table table-bordered">
  <h1 class="t_nav"><span>删删写写，回回忆忆。</h1>
      <ul class="arrow_box">
     <?php 
       foreach ($res as $v) {
       echo   '<img src="/home/public/images/001.png">
       <p>作者：'.$v['uid'].'</p>
       <p>标题：'.$v['title'].'</p>
      <p>内容：'.$v['content'].'</p>
      </div>
      <span class="dateview">'.date('Y-m-d H:i:s',$v['time']).'</span>
      <a href="/home/message/del.php?id='.$v['id'].'"><span>删除</span></a>
      ';
       }
      ?>
    </ul>
<!--   <div class="bloglist" style="width:100%;height:400px;">

  </div> -->
     
        <div class="result-wrap">
            <div class="result-content">
                <form action="/home/message/addy.php" method="post" id="myform" name="myform" enctype="multipart/form-data">
                    <table class="insert-tab" width="100%">
                        <tbody>
                          
                                    <input id="uid" name="uid" size="50" value="<?php echo isset($_SESSION['name'])?$_SESSION['name']:'' ?>" type="hidden">
                            
                        

                        <tr>
                                <th><i class="require-red">* </i>标题：</th>
                                <td>
                                    <input class="common-text required" id="title" name="title" size="50" value="" type="text">
                                </td>
                            </tr>
                            <tr>
                                <th><i class="require-red">* </i>内容：</th>
                                <td><script id="editor" type="text/plain" style="width:1024px;height:500px;" name="content"></script></td>
                                <script type="text/javascript">
                                 var ue = UE.getEditor('editor');
                                 </script>
                                </td>
                            </tr>
                             
                            <tr>
                                <th></th>
                                <td>
                                    <input class="btn btn-primary btn6 mr10" value="提交" type="submit">
                                    <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button">
                                </td>
                            </tr>
                        </tbody></table>
                </form>
            </div>
        </div>
  </div>
  <?php 
     echo '<center>';
     echo page($config,'message');
     echo '</center>';
     ?>
  <div class="page"><a title="Total record"><b>41</b></a><b>1</b><a href="/news/s/index_2.html">2</a><a href="/news/s/index_2.html">&gt;</a><a href="/news/s/index_2.html">&gt;&gt;</a></div>
</div>
<?php include_once($_SERVER['DOCUMENT_ROOT'].'/home/public/footer.php'); ?>